#!/bin/sh

# Order is important.

cat >../textdump <<END
name sys 0
name root 1
END

dbref=1

grep -E '^object[[:space:]]+' *.c--  | while read line ; do
	dbname=`echo $line | awk '{ print $2 }'`
	if [ ! $dbname = "root" -a ! $dbname = "sys" ] ; then
		dbref=`expr $dbref + 1`
		echo "name $dbname $dbref" >>../textdump
	fi
done

echo >> ../textdump

for fn in *.c-- ; do
	cat $fn >>../textdump
done

